import { createStore } from "../../components/My-redux";
import applayMiddleware from "../../components/My-redux/applayMiddleware";
import logger from "../../components/My-redux/logger";
import thunk from "../../components/My-redux/thunk";
import promise from "../../components/My-redux/promise";

const initState = {
    count: 0
}


const countReducer = (state = initState, action:IAction) => {
    switch(action.type) {
        case 'ADD' : 
        state.count += 1
        break
        default:
            break
    }
    return state
}

const store = createStore(countReducer, applayMiddleware(promise, logger, thunk))

export default store